<%--
  Created by IntelliJ IDEA.
  User: 门铎
  Date: 2016/6/24
  Time: 9:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Title</title>
    <!-- BOOTSTRAP STYLES-->
    <link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME STYLES-->
    <link href="${pageContext.request.contextPath}/css/font-awesome.css" rel="stylesheet" />
    <!--CUSTOM BASIC STYLES-->
    <link href="${pageContext.request.contextPath}/css/basic.css" rel="stylesheet" />
    <!--CUSTOM MAIN STYLES-->
    <link href="${pageContext.request.contextPath}/css/custom.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/css//jquery.dataTables.min.css" rel="stylesheet" />
</head>
<body>
<div id="wrapper">
    <jsp:include page="../manage/nav-top.jsp"/>
    <jsp:include page="../manage/nav.jsp"/>
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper">
        <div id="page-inner">
            <div class="row">
                <div class="col-md-12">
                    <ol class="breadcrumb">
                        <li><a href="#">首页</a></li>
                        <li class="active">用户列表</li>
                    </ol>
                    <hr />
                    <ul class="nav nav-pills">
                        <li class="active">
                            <a href="${pageContext.request.contextPath}/cimv/user/list">
                                <i class="glyphicon glyphicon-user"></i>用户列表
                            </a>
                        </li>
                        <li>
                            <a href="${pageContext.request.contextPath}/cimv/user/new">
                                <i class="glyphicon glyphicon-plus"></i>新建用户
                            </a>
                        </li>
                    </ul>
                    <hr />
                    <div class="alert alert-success">
                        ${msg}
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-md-12">
                    <table id="myTable" class="table table-bordered table-striped table-hover data-table">
                        <thead>
                        <tr>
                            <th>排序id</th>
                            <th>id</th>
                            <th>用户名</th>
                            <th>权限</th>
                            <th>创建日期</th>
                            <th>更新日期</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="user" items="${userList}">
                            <tr>
                                <td>${user.sid}</td>
                                <td>${user.id}</td>
                                <td>${user.userName}</td>
                                <td>
                                    <c:if test="${user.role ==1}">管理员</c:if>
                                    <c:if test="${user.role ==2}">用户</c:if>
                                </td>
                                <td>${user.createDate}</td>
                                <td>${user.updateDate}</td>

                                <td>
                                    <a href="/cimv/user/details/${user.id}" class="btn btn-xs btn-success">
                                        <i class="glyphicon glyphicon-plus"></i> 完善
                                    </a>
                                    <a href="/cimv/user/update/${user.id}" class="btn btn-xs btn-info">
                                        <i class="glyphicon glyphicon-pencil"></i> 更改
                                    </a>
                                    <a  href="/cimv/user/delete/${user.id}" class="btn btn-xs btn-danger">
                                        <i class="glyphicon glyphicon-remove"></i> 删除
                                    </a>
                                </td>
                            </tr>
                        </c:forEach>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!-- /. PAGE WRAPPER  -->
</div>
<!-- /. WRAPPER  -->

<jsp:include page="../manage/footer.jsp" />
<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<!-- JQUERY SCRIPTS -->
<script src="${pageContext.request.contextPath}/js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<!-- METISMENU SCRIPTS -->
<script src="${pageContext.request.contextPath}/js/jquery.metisMenu.js"></script>
<!-- CUSTOM SCRIPTS -->
<script src="${pageContext.request.contextPath}/js/custom.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/js/dateTable.boostrap.js"></script>
<script>
    $(document).ready(function(){
        $('#myTable').DataTable({
            language: {
                "sProcessing": "处理中...",
                "sLengthMenu": "显示 _MENU_ 项结果",
                "sZeroRecords": "没有匹配结果",
                "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                "sInfoPostFix": "",
                "sSearch": "搜索:",
                "sUrl": "",
                "sEmptyTable": "表中数据为空",
                "sLoadingRecords": "载入中...",
                "sInfoThousands": ",",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上页",
                    "sNext": "下页",
                    "sLast": "末页"
                },
                "oAria": {
                    "sSortAscending": ": 以升序排列此列",
                    "sSortDescending": ": 以降序排列此列"
                }
            }
        });
    });
</script>

</body>

</html>
